<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ page import="com.esaheki.flashcards.dao.*"%>
<%@ page import="com.esaheki.flashcards.classes.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.NumberFormat"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!-- Header -->
<c:import url="/includes/header.jsp">
<c:param name="title" value="FlashCards: Add" />
</c:import>
<!-- Header -->

<div class="colmask leftmenu"> 
<div class="colright"> 
<div class="col2"> 
<!-- Column Left --> 
            
<c:import url="/tree.jsp" />

<!-- Column Left --> 
</div>

<div class="col1wrap"> 
<div class="col1"> 

<!-- Column Right --> 
<%
String type = request.getParameter("type");
String id = request.getParameter("id");
String referer = request.getHeader("referer");

String temp = "";
CardDAO cardDao = new CardDAO();
CategoryDAO catDao = new CategoryDAO();
UserDAO userDao = new UserDAO();

if (type.equals("user")) {
	temp = "User";
	%>
	<h2>Add User</h2>
	<form action="add">
	<div>
	<label for="name">User Name</label>
	<input type="text" maxlength="100" name="name" id="name" size="50" value="" />
	</div>
	<div>
	<%
}
else if (type.equals("cat")) {
	temp = "Category";
	%>
	<h2>Add Category</h2>
	<form action="add">
	<div>
	<label for="name">Category Name</label>
	<input type="text" maxlength="100" name="name" id="name" size="50" value="" />
	</div>
	<div>
	<%
}
else if (type.equals("card")) {
	temp = "Card";
	%>
	<h2>Add Card</h2>
	<form action="add">
	<div>
	<label for="front">Front</label>
	<input type="text" maxlength="100" name="front" id="front" size="50" value="" />
	</div>
		<div>
	<label for="back">Back</label>
	<input type="text" maxlength="100" name="back" id="back" size="50" value="" />
	</div>
	<div>
	<%
}

%>
	<input type="hidden" name="type" value="<%=type %>" />
	<input type="hidden" name="id" value="<%=id %>" />
	<input type="hidden" name="referer" value="<%=referer %>" />
	<input type="submit" name="op" id="submit" value="Add <%=temp %>"  />
	</div>
	</form>

<!-- Column Right --> 
</div> 
</div> 
</div> 
</div> 

<!-- Footer -->
<c:import url="/includes/footer.jsp" />
<!-- Footer -->